package com.sniff.atp.service.settlement;

import com.alibaba.fastjson2.JSONObject;
import com.sniff.atp.dto.ClientLoginDTO;
import com.sniff.atp.dto.ContentDTO;
import com.sniff.atp.enums.api.SettlementAPI;
import com.sniff.atp.utils.Headers;
import com.sniff.atp.utils.HttpClientUtil;
import com.sniff.atp.utils.JsonUtil;
import org.springframework.stereotype.Service;

@Service
public class SettlementService {

    public String queryFundFlow(ClientLoginDTO clientLoginDTO, String platformOrderNo) {
        JSONObject params = JsonUtil.readJson("settlement/QueryFundList", new ContentDTO("platformOrderNo", platformOrderNo));
        params.put("customerShopId", clientLoginDTO.getShopId());
        return new HttpClientUtil(Headers.setClientHeader(clientLoginDTO)).doPostJson(SettlementAPI.QUERY_FUND_LIST.getApi(), params);
    }
}
